<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<include file="Public/header" />
</head>
<body>
<script type="text/javascript">
	var getarrivalUrl="{:U('Depot/get_erp')}";
	var examineUrl="{:U('Depot/get_examine')}";
	var erpDelUrl="{:U('Depot/erpDel')}";
	var booksUrl="{:U('Depot/books')}";// 账册管理
	<!-- using('../../../default/js/erp.js'); -->

    //搜索
    function erpSearch(value,name){
        if(value==''){
            $.messager.alert('搜索提示','搜索内容不能为空!','error');
        }else{
            var searchName=$.trim($('#erpsearchInput').searchbox('getName'));
            var searchValue=$.trim($('#erpsearchInput').searchbox('getValue'));
			
            switch(searchName){
                case 'code':
                    $('#erpDatagrid').datagrid({ queryParams:{code:searchValue}});
                    break;
                case 'name':
                    $('#erpDatagrid').datagrid({ queryParams:{name:searchValue}});
                    break;
            }
        }
    }
</script>
<script type="text/javascript" src="__PUBLIC__/default/js/erp.js"></script>

	<table id="erpDatagrid" toolbar="#erp_tb"></table>
	<!-- 添加 -->
    <div id="erpAddDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#erpAddButtons"  modal="true">
        <form id="erpAddForm" method="post" novalidate>          
            <div class="fitem">
                <label>企业编号</label>
                <input name="code" class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]','exists[\'企业编号\',\'{:U('Depot/checkErpCode','','')}\']']" />
            </div>
            <div class="fitem">
                <label>企业名称</label>
                <input name="name" id="name" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>域名URL</label>
                <input name="url"  type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30" />
            </div> 
        </form>
    </div>
    <div id="erpAddButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="erpObj.add('{:U('Depot/erpAdd')}')" style="width:90px">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#erpAddDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /添加 -->
	<!-- 编辑 -->
    <div id="erpEditDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#erpEditButtons"  modal="true">
        <form id="erpEditForm" method="post" novalidate>          
            <div class="fitem">
                <label>企业编号</label>
                <input name="id"  type="hidden" />
                <input name="code"  type="text" class="easyui-textbox" data-options="disabled:true,required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
            <div class="fitem">
                <label>企业名称</label>
                <input name="name"  type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div> 
			<div class="fitem">
                <label>域名URL</label>
                <input name="url"  type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30" />
            </div> 
        </form>
    </div>
    <div id="erpEditButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="erpObj.save('{:U('Depot/erpSave')}')" style="width:90px">更新</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#erpEditDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /编辑 -->  
    <!-- 搜索栏 -->
    <div id="erp_tb">
        <form id="erpSearchForm" method="post" novalidate>
             <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon icon-all" plain="true" onclick="erpObj.showAll()">全部</a>     
            <input id='erpsearchInput' class="easyui-searchbox" data-options="height:30,menu:'#erpSearchbox',searcher:erpSearch"  style="width:300px"/>
            <div id="erpSearchbox">
                <div data-options="name:'code',iconCls:'icon icon-msn'">企业编号</div>
                <div data-options="name:'name',iconCls:'icon-email'">企业名称</div>
            </div>
        </form>
		<a href="javascript:void(0)" onclick="erpObj.infoBar()" class="easyui-linkbutton" data-options="iconCls:'icon-application_form',plain:true">查看账册</a>
		<a href="javascript:void(0)" onclick="erpObj.addBar()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a>
        <a href="javascript:void(0)" onclick="erpObj.editBar()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
        <a href="javascript:void(0)" onclick="erpObj.removeBar()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a>
        <a href="javascript:void(0)" onclick="erpObj.examineBar(1)" class="easyui-linkbutton" data-options="iconCls:'icon-key',plain:true">审核通过</a>
		<a href="javascript:void(0)" onclick="erpObj.examineBar(2)" class="easyui-linkbutton" data-options="iconCls:'icon-key_delete',plain:true">审核不通过</a>
    </div>
    <!-- /搜索栏 -->
</body>